package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/22 17:19
 * @description :
 */
public enum WorkerOrderTimeFilter {
    ALL(-1,"全部"),
    TODAY(0,"当天"),
    CURRENT_WEEK(1,"本周"),
    CURRENT_MONTH(2,"本月");

    private int code;
    private String message;

    WorkerOrderTimeFilter(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static WorkerOrderTimeFilter getByCode(Integer code){
        if(code == null){
            return null;
        }

        WorkerOrderTimeFilter[] values = WorkerOrderTimeFilter.values();
        for (WorkerOrderTimeFilter value : values) {
            if(value.code == code.intValue()){
                return value;
            }
        }
        return null;
    }
}
